-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ddl: Fix exchange partition impl #8379
Conversation
@@ -317,68 +459,63 @@ void SchemaBuilder<Getter, NameMapper>::applySetTiFlashReplica(DatabaseID databa | |||
} | |||
|
|||
applyDropTable(db_info->id, table_id); | |||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in applySetTiFlashReplica
is adding return
instead of nesting if ... else ...
. Make code more clear and simple.
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Others LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hongyunyan, Lloyd-Pottiger The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
/run-all-tests |
/hold
|
/run-all-tests |
/unhold |
@JaySon-Huang: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests
If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/build |
/hold |
db0784c
to
742c0b9
Compare
1c189c7
to
99f6adc
Compare
1fa824a
to
99b3dc7
Compare
/run-all-tests |
/run-all-tests |
What problem does this PR solve?
Issue Number: close #8378
Problem Summary:
TableIDMap::emplaceTableID
/TableIDMap::emplacePartitionTableID
should check whether the old value is the same as new value before logging a warning message. Or there could be too many meanless warning logging.if ... else ...
inapplySetTiFlashReplica
is too deep and hard to readexchange partition
in table id mapping is not atomic, this may make other functions get something wrongtiflash/dbms/src/TiDB/Schema/SchemaBuilder.cpp
Lines 128 to 131 in 1addc37
What is changed and how it works?
ALTER TABLE ... EXCHANGE PARTITION
#8372exchange partition
to be an atomic functionTableIDMap::exchangeTablePartition
TableIDMap::emplaceTableID
/TableIDMap::emplacePartitionTableID
check whether the old value is the same as new value before logging a warning messagedo ... while ... break
to make "renaming old non-partition table belonging new database" fail not affect "renaming the exchanged partition table belonging new database"return
to simplifyapplySetTiFlashReplica
Check List
Tests
Side effects
Documentation
Release note